#!/usr/bin/env python
# -*- coding: UTF-8 -*-
# @Project:     rest_flask
# @File:        response.py
# @Author:      Fan GuiChuan
# @Date:        2025/6/26 15:34
# @Version:     Python3.7
# @Description:
from flask import jsonify


def success_response(data=None, message="success", code=200):
    return jsonify({
        "code": code,
        "message": message,
        "data": data
    }), code


def error_response(message, code=400):
    return jsonify({
        "status": "error",
        "code": code,
        "message": message,
    }), 200
